package com.tecent.chat.data;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

public class ActivityList {

    private static List<Activity> activities = new ArrayList<>();

    public static void add(Activity a) {
        activities.add(a);
    }

    public static void remove(Activity a) {
        activities.remove(a);
    }

    public static void finishAll() {
        for (Activity a : activities) {
            if (!a.isFinishing()) {
                a.finish();
            }
        }
        activities.clear();
    }
}
